package com.gas.gm.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.gas.gm.model.Message;

@Repository("messageDao")
public class MessageJPADao extends GasApplicationDao<Message> implements
		MessageDao {

	@SuppressWarnings("unchecked")
	public List<Message> findAllMessages() {
		return entityManager.createQuery("select m from Message m").getResultList();
	}

	public Message findMessage(Long id) {
		return entityManager.find(Message.class, id);
	}

	

}
